<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">

    <title>点餐列表</title>
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
    <link rel="stylesheet" th:href="@{/assets/css/common.css}">
</head>
<body class="body">
<!--导航-->
<div th:replace="common/nav :: nav(true)"></div>
<div class="container">
    <!--<div class="page-header" style="margin-top: 20px;top:50%;">
        <h1 class="text-primary">凯捷科技 <small>简易点餐</small></h1>
    </div>-->
    <div class="row row-nocol">


        <form class="form-inline lookup" role="form" method="post">


            <div class="form-group" style="margin-left: 5px">
                <label class="control-label" for="lookup-startDate">开始时间</label>
                <div class="input-group">
                    <!--/*@thymesVar id="endDate" type="java.util.Date"*/-->
                    <input class="datetime form-control input-sm" id="lookup-startDate" name="startDate" type="text"
                           th:value="${#dates.format(pager.lookup.startDate, 'yyyy-MM-dd')}"
                           data-date-format="yyyy-mm-dd" data-min-view="2"
                           data-end-date-target="endDate" readonly placeholder="开始日期"/>
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label" for="lookup-endDate">结束时间</label>
                <div class="input-group">
                    <input class="datetime form-control input-sm" id="lookup-endDate" name="endDate" type="text"
                           th:value="${#dates.format(pager.lookup.endDate, 'yyyy-MM-dd')}"
                           data-date-format="yyyy-mm-dd" data-min-view="2"
                           data-picker-position="bottom"
                           data-start-date-target="startDate" readonly placeholder="结束日期"/>
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label" for="lookup-title">标题</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-title" name="startTitle" type="text"
                           th:value="${pager.lookup.startTitle}"/>
                </div>
            </div>
            <div class="form-group" style="margin-left: 5px">
                <label class="control-label" for="lookup-userName">用户名</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-userName" name="userName" type="text"
                           th:value="${pager.lookup.userName}"/>
                </div>
            </div>


            <div class="form-group" style="margin-left: 5px">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="latest" value="true"
                               th:attr="checked=${pager.lookup.latest != null && pager.lookup.latest }"> <span
                            class="text-success">最后开启</span>
                    </label>
                </div>
            </div>
            <div class="form-group form-btn-bar pull-right">
                <button type="submit" class="btn btn-primary btn-sm">
                    <i class="glyphicon glyphicon-search"></i> 查询
                </button>
                <button type="button" class="btn btn-info btn-sm reset">
                    <i class="glyphicon glyphicon-refresh"></i> 重置
                </button>
            </div>

        </form>
        <hr/>
        <!-- 操作信息提示的地方 -->
        <div th:if="${remind}" class="alert alert-${ remind.level  }"
             th:classappend="'alert-' + ${remind.level}">
            <button data-dismiss="alert" class="close" type="button">
                <i class="glyphicon glyphicon-remove"></i>
            </button>
            <span th:remove="tag" th:utext="${ remind.message }"></span>
        </div>
        <!--列表栏-->
        <form class="nocol">
            <div class="action-bar">
                <a class="btn btn-xs btn-success " th:href="@{/order/exportLatest}">
                    <i class="glyphicon glyphicon-repeat">导出最后</i>
                </a>
                <button class="btn btn-xs btn-info " id="exportAll">
                    <i class="glyphicon glyphicon-export">导出查询</i>
                </button>
            </div>
            <!--     <div class="action-bar">
                     <a class="btn btn-sm btn-success" th:href="@{/start/open}">
                         <i class="glyphicon glyphicon-plus"></i> 开启点餐
                     </a>
                 </div>-->

            <table class="table table-striped  table-hover table-bordered">
                <thead>
                <tr class="text-center">
                    <th>日期</th>
                    <th>标题</th>
                    <th>姓名</th>
                    <th>套餐</th>
                    <th>部门</th>
                    <th class="text-info">操作</th>
                </tr>
                </thead>
                <tbody align="center">
                <!-- <c:forEach items="${ pager.datas}" var="cur" varStatus="status"> -->
                <tr th:each="cur:${pager?.datas}">
                    <td th:text="${#dates.format(cur.date, 'yyyy-MM-dd')}">2021-12-12</td>
                    <td th:text="${cur.startTitle}">张三</td>
                    <td class="text-info " th:text="${cur.userName}">张三</td>
                    <td th:text="${cur.describe}">套餐一</td>
                    <td th:text="${cur.departmentName}">开启</td>
                    <td>
                        <div class="btn-group-dis">
                            <!--<a class="btn btn-xs btn-success " th:href="@{'/order/'+${cur.id}}"
                               data-toggle="tooltip" title="编辑"> <i
                                    class="glyphicon glyphicon-edit"></i>
                            </a>-->
                            <button class="btn btn-xs btn-danger action-get" type="button"
                                    th:attr="data-url='/order/cancle/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="删除" data-confirm="确认删除本条记录吗">
                                <i class="glyphicon glyphicon-trash"></i>
                            </button>
                        </div>
                    </td>
                </tr>
                <!-- </c:forEach> -->
                </tbody>
            </table>

        </form>
        <!--页码相关-->
        <div th:replace="common/pager :: pager"></div>
    </div>


</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script>
    $("#exportAll").on("click", function () {
        var $form = $('form.lookup').clone().appendTo($("body"));
        $form.attr("method", "post").attr("action", ctx + "/order/exportAll");
        $form.submit();
        $form.remove();
    });

</script>
</body>
</html>